d5e4872cca2b296f1549ecc1cc0bc851dd908ea4,grails-bootstrap/src/main/groovy/org/codehaus/groovy/grails/cli/support/ClasspathConfigurer.java,ClasspathConfigurer,getClassLoaderUrls,#BuildSettings#File#Set#boolean#,91
Before Change
@SuppressWarnings("hiding") boolean skipPlugins) throws MalformedURLException {
List<URL> urls = new ArrayList<URL>();
try {
// If 'grailsHome' is set, make sure the script cache directory takes precedence
// over the "grails-scripts" JAR by adding it first.
if (settings.getGrailsHome() != null) {
urls.add(cacheDir.toURI().toURL());
}
// Add the "resources" directory so that config files and the
// like can be picked up off the classpath.
if (settings.getResourcesDir() != null && settings.getResourcesDir().exists()) {
urls.add(settings.getResourcesDir().toURI().toURL());
}
// Add build-only dependencies to the project
final boolean dependenciesExternallyConfigured = settings.isDependenciesExternallyConfigured();
// add dependencies required by the build system
final List<File> buildDependencies = settings.getBuildDependencies();
if (!dependenciesExternallyConfigured && buildDependencies.isEmpty()) {
GrailsConsole.getInstance().error("Required Grails build dependencies were not found. Either GRAILS_HOME is not set or your dependencies are misconfigured in grails-app/conf/BuildConfig.groovy");
cleanResolveCache(settings);
System.exit(1);
}
addDependenciesToURLs(excludes, urls, buildDependencies);
// add dependencies required at development time, but not at deployment time
addDependenciesToURLs(excludes, urls, settings.getProvidedDependencies());
// Add the project's test dependencies (which include runtime dependencies) because most of them
// will be required for the build to work.
addDependenciesToURLs(excludes, urls, settings.getTestDependencies());
// Important, we call these so they're properly initialized!
settings.getRuntimeDependencies();
After Change
// add dependencies required by the build system
final List<File> buildDependencies;
buildDependencies = settings.getBuildDependencies();
if (!dependenciesExternallyConfigured && buildDependencies.isEmpty()) {
GrailsConsole.getInstance().error("Required Grails build dependencies were not found. Either GRAILS_HOME is not set or your dependencies are misconfigured in grails-app/conf/BuildConfig.groovy");
cleanResolveCache(settings);
System.exit(1);
}
addDependenciesToURLs(excludes, urls, buildDependencies);
// add dependencies required at development time, but not at deployment time
addDependenciesToURLs(excludes, urls, settings.getProvidedDependencies());
// Add the project's test dependencies (which include runtime dependencies) because most of them
// will be required for the build to work.
addDependenciesToURLs(excludes, urls, settings.getTestDependencies());
// Important, we call these so they're properly initialized!
settings.getRuntimeDependencies();
settings.getCompileDependencies();
// Add the libraries of both project and global plugins.
if (!skipPlugins) {
for (File dir : pluginPathSupport.listKnownPluginDirs()) {
addPluginLibs(dir, urls, settings);
}
}
ResolveReport buildResolveReport = settings.getBuildResolveReport();
if (buildResolveReport != null && buildResolveReport.hasError()) {
handleResolveError(settings, buildResolveReport);
}
ResolveReport compileResolveReport = settings.getCompileResolveReport();
if (compileResolveReport != null && compileResolveReport.hasError()) {
handleResolveError(settings, compileResolveReport);
}
ResolveReport runtimeResolveReport = settings.getRuntimeResolveReport();
if (runtimeResolveReport != null && runtimeResolveReport.hasError()) {
handleResolveError(settings, runtimeResolveReport);
}
ResolveReport testResolveReport = settings.getTestResolveReport();
if (testResolveReport != null && testResolveReport.hasError()) {
handleResolveError(settings, testResolveReport);
}
ResolveReport providedResolveReport = settings.getProvidedResolveReport();
if (providedResolveReport != null && providedResolveReport.hasError()) {